<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>v-model实例</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>

<body>
    <h1>v-model实例</h1>
    <a href="../index.html">返回</a>
    <hr/>
    <div id="app">

        <p>原始数据：{{message}}[测试后缀]</p>
        <h3>文本框</h3>
        <input type="text" v-model="message" /><br/>
        <p>懒加载v-model-lazy: 鼠标离开才修改</p>
        <input type="text" v-model.lazy="message" /><br/>
        <p>数字类型: v-model-number: 需要是数字(需要默认是数字才行，如果默认是文本就不能规范)</p>
        <input type="text" v-model.number="message" /><br/>
        <p>v-model-trim 去除首尾的空格</p>
        <input type="text" v-model.trim="message" /><br />
        <hr/>
        <p>文本域 </p>
        <textarea cols="30" rows="5" v-model="message"></textarea>
        <hr/>
        <p>多选按钮绑定一个值</p>
        <input type="checkbox" id="rst" v-model="isTrue" />
        <label for="rst">单选结果</label>
        <p>多选绑定一个数组</p>
        <p>
            <input type="checkbox" id="zhangsan" value="xxx" v-model="students" />
            <label for="zhangsan">张三</label>
            <input type="checkbox" id="lisi" value="yyy" v-model="students" />
            <label for="lisi">李四</label>
            <input type="checkbox" id="wangwu" value="zzz" v-model="students" />
            <label for="wangwu">wangwu</label>

        </p>
        <p>{{students}}</p>
        <p>单选</p>
        <p><input type="radio" id="one" value="男" v-model="sex">
            <label for="one">男</label>
            <input type="radio" id="two" value="女" v-model="sex">
            <label for="two">女</label> 你选择的性别是:{{sex}}
        </p>
    </div>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                message: "hello world",
                isTrue: true,
                students: [],
                sex: '男'

            }
        })
    </script>
</body>

</html>